leak fixes for shape, ggv_ovl, nmea.
authortsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 5 Jan 2014 01:38:33 +0000 (01:38 +0000)
committertsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 5 Jan 2014 01:38:33 +0000 (01:38 +0000)
and a bit of NEW_STRINGS cleanup.

git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4710 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/exif.cc
gpsbabel/ggv_ovl.cc
gpsbabel/nmea.cc
gpsbabel/shape.cc
gpsbabel/xcsv.cc

index 6c9f9396e528f333988b5aeeb05c3925971dfa52..7f92bcf4fc9798d3819ab63608920244a1d22666 100644 (file)
@@ -892,14 +892,7 @@ exif_waypt_from_exif_app(exif_app_t* app)
     if (((c = strchr(cx, '.'))) && (c != cx)) {
       *c = '\0';
     }
-#if NEW_STRINGS
     wpt->shortname = cx;
-#else
-    if (wpt->shortname) {
-      xfree(wpt->shortname);
-    }
-    wpt->shortname = xstrdup(cx);
-#endif
     xfree(str);
   }
 
index 9ef4e1ca37fa486fbbd2331074d9c7a9651c5059..cd68c551e458539e0fca130e116d80c6d81ca0cc 100644 (file)
@@ -175,7 +175,7 @@ ggv_ovl_read(void)
     case OVL_SYMBOL_TRIANGLE:
 
       wpt = waypt_new();
-      wpt->shortname = xstrdup(symbol);
+      wpt->shortname = symbol;
 
       if ((cx = inifile_readstr(inifile, symbol, "YKoord"))) {
         wpt->latitude = atof(cx);
index ffd0e4cc77d45b3e03f7eab7fb03d2a765298b6a..0ed98b044fed06b44d4b9ae08b329310ef0f9dab 100644 (file)
@@ -287,14 +287,7 @@ nmea_rd_init(const char* fname)
     if (!wpt) {
       return;
     }
-#if NEW_STRINGS
     wpt->shortname = "Position";
-#else
-    if (wpt->shortname) {
-      xfree(wpt->shortname);
-    }
-    wpt->shortname = xstrdup("Position");
-#endif
     nmea_add_wpt(wpt, NULL);
     return;
   }
@@ -646,7 +639,7 @@ gpwpl_parse(char* ibuf)
   }
   waypt->longitude = ddmm2degrees(lngdeg);
 
-  waypt->shortname = xstrdup(sname);
+  waypt->shortname = sname;
 
   curr_waypt = NULL; /* waypoints won't be updated with GPS fixes */
   nmea_add_wpt(waypt, NULL);
index 8aa9ba58eb41388491d7217cd0409625e6bc5cfa..8f7f6c6f44026f85da0ea36f240e9e10b5e5adc0 100644 (file)
@@ -185,7 +185,7 @@ my_read(void)
       wpt = waypt_new();
       wpt->latitude = shp->dfYMin;
       wpt->longitude = shp->dfXMin;
-      wpt->shortname = xstrdup(name);
+      wpt->shortname = name;
       if (url) {
         wpt->AddUrlLink(url);
       }
index 76b33e5cf79d2c3becde9449745d560caec80d78..cfbc84ac03155eb2b48df0dad8684f0f4cbb4afc 100644 (file)
@@ -704,14 +704,7 @@ xcsv_wr_position(waypoint* wpt)
   /* Tweak incoming name if we don't have a fix */
   switch (wpt->fix) {
   case fix_none:
-#if NEW_STRINGS
     wpt->shortname = "ESTIMATED Position";
-#else
-    if (wpt->shortname) {
-      xfree(wpt->shortname);
-    }
-    wpt->shortname = xstrdup("ESTIMATED Position");
-#endif
     break;
   default:
     break;